package com.biz.primus.ms.payment.api;

import com.biz.primus.model.payment.vo.req.AllInPayCardAddReqVo;
import com.biz.primus.model.payment.vo.req.AllInPayCardChangeReqVo;
import com.biz.primus.model.payment.vo.req.AllInPayCardOpenReqVo;
import com.biz.primus.model.payment.vo.resp.AllInPayCardChangePwdRespVo;
import com.biz.primus.model.payment.vo.resp.AllInPayCardOpenAccountRespVo;
import com.biz.primus.model.payment.vo.resp.AllInPayRechargeRespVo;
import com.biz.primus.ms.base.api.BaseApiController;
import com.biz.primus.ms.payment.service.AllInPayCardService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * AllInPayCardService
 *
 * @author JKLiues
 * @date 2017年11月13日
 */
@RestController
@RequestMapping("allInPayCardService")
public class AllInPayCardApiController extends BaseApiController {

    private final AllInPayCardService allInPayCardService;

    @Autowired
    public AllInPayCardApiController(AllInPayCardService allInPayCardService) {
        this.allInPayCardService = allInPayCardService;
    }


    @ApiOperation("充值")
    @PostMapping("add")
    public AllInPayRechargeRespVo addCard(@RequestBody AllInPayCardAddReqVo reqVo) {
        return allInPayCardService.addCard(reqVo);
    }

    @ApiOperation("改密")
    @PostMapping("change")
    public AllInPayCardChangePwdRespVo changePassword(@RequestBody AllInPayCardChangeReqVo reqVo) {
        return allInPayCardService.changePassword(reqVo);
    }

    @ApiOperation("开卡")
    @PostMapping("open")
    public AllInPayCardOpenAccountRespVo openCard(@RequestBody AllInPayCardOpenReqVo reqVo) {
        return allInPayCardService.openCard(reqVo);
    }
}